﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1.DesignerPatter.Mediator
{
    class ConcreteMediator:Mediator
    {
        private ConcreteColleague1 con1;
        private ConcreteColleague2 con2;

        public ConcreteColleague1 Con1
        {
            set { con1 = value; }
        }

        public ConcreteColleague2 Con2
        {
            set { con2 = value; }
        }

        public override void Send(string message, Colleague colleague)
        {
            if (colleague == con1)
            {
                con1.Notify(message);
            }
            else
            {
                con2.Notify(message);
            }
        }
    }
}
